﻿@{
    ViewBag.Title = "发布休假统计";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}

<div class="main layui-clear">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>发布休假统计</legend>
    </fieldset>
    <div class="layui-form layui-form-pane">
        <form method="post" action="Add">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">休假年份</label>
                    <div class="layui-input-block">
                        <input id="Year" name="Year" class="layui-input" value="@DateTime.Now.Year" readonly="readonly">
                    </div>
                </div>
                <div class="layui-inline">
                    <label for="filename" class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" id="Title" name="Title" required lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <span>例：国庆节休假</span>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="filename" class="layui-form-label">假期开始：</label>
                    <div class="layui-input-block">
                        <input id="StartDate" name="StartDate" class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">假期结束</label>
                    <div class="layui-input-block">
                        <input id="EndDate" name="EndDate" class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <label class="layui-form-label" id="days"></label>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-normal" lay-filter="add" lay-submit>信息提交</button>
            </div>
        </form>
    </div>
</div>
@section scripts{
    <script>
        layui.use(['laydate', 'jquery', 'count'], function () {
            var laydate = layui.laydate;
            var $ = layui.jquery;
            var count = layui.count;
            laydate.render({
                elem: '#StartDate'
                , type: 'date'
                , trigger: 'click'
                , format: 'yyyy/MM/dd'
                , theme: '#558AC0'
                , calendar: true
                , done: function (value) {
                    count.compareDate(value, $('#EndDate').val());
                }
            });

            laydate.render({
                elem: '#EndDate'
                , type: 'date'
                , trigger: 'click'
                , format: 'yyyy/MM/dd'
                , theme: '#558AC0'
                , calendar: true
                , done: function (value) {
                    count.compareDate($('#StartDate').val(), value);
                }
            });
        });
    </script>
}